<?php

/**
 * LoginForm class.
 * LoginForm is the data structure for keeping
 * user login form data. It is used by the 'login' action of 'SiteController'.
 */
class ChangePasswordForm extends CFormModel
{
	public $oldpassword;
	public $password;
	public $password1; 
	 
	/**
	 * Declares the validation rules.
	 * The rules state that username and password are required,
	 * and password needs to be authenticated.
	 */
	public function rules()
	{
		return array(
			array('oldpassword', 'required', 'on'=>'changePasswd', 'message'=>'这个不能空白的哦^_^'),
			array('password, password1', 'required', 'message'=>'这个不能空白的哦^_^'), 
			
			array('password1', 'compare', 'compareAttribute'=>'password','message'=>'你二次的输的不一样耶。^_^'),
		);
	}

	/**
	 * Declares attribute labels.
	 */
	public function attributeLabels()
	{
		return array(
			'oldpassword'=>'原密码',
			'password'=>'新密码',
			'password1'=>'确认密码', 
		);
	}

	
	public function model ($className = __CLASS__)
    {
        return User::model();
    }
}
